package com.base.view.dialog;

import android.os.Bundle;
import android.widget.TextView;

import com.base.control.MActivitySupport;
import com.base.framework.R;

/**
 * Created by yjh on 15-3-11.
 */
public class MessageHintDialog extends DialogWithTwoBtn {
    private TextView titleTv;
    private TextView contentTv;
    private boolean leftBtnShow;
    private String title;
    private String content;


    public MessageHintDialog(MActivitySupport context, boolean leftBtnShow, String title, String content) {
        this(context, R.style.MDialogStyle, leftBtnShow, title, content);
    }
    public MessageHintDialog(MActivitySupport context, int theme, boolean leftBtnShow, String title, String content){
        super(context, theme);
        this.leftBtnShow = leftBtnShow;
        this.title = title;
        this.content =content;
    }

    @Override
    public void create(Bundle savedInstanceState) {
        setContentView(R.layout.dialog_message_hint);

        titleTv = mfindViewById(R.id.dialog_message_title);
        contentTv = mfindViewById(R.id.dialog_message_content);
        leftBtn = mfindViewById(R.id.dialog_message_cancel);
        rightBtn = mfindViewById(R.id.dialog_message_ok);

        leftBtnShow(leftBtnShow);
        setTitle(title);
        setContent(content);

        leftBtn.setOnClickListener(getLeftBtnListener());

        rightBtn.setOnClickListener(getRightBtnListener());
    }



    //设置显示内容
    public void setTitle(String title) {
        this.titleTv.setText(title);
    }

    public void setContent(String content) {
        this.contentTv.setText(content);
    }



    public MessageHintDialog getThis() {
        return this;
    }

}
